#include "enemyplane.h"

enemyplane::enemyplane()
{
    menemy.load(":/sucai/10012.png");
    mx=0;
    my=0;
    mfree=true;
    mspeed=5;
    mrect.setWidth(menemy.width());
    mrect.setHeight(menemy.height());
    mrect.moveTo(mx,my);
}

void enemyplane::updatePosition()
{
    //空闲状态敌机，不计算坐标
    if(mfree)
    {
        return;
    }
    my+=mspeed;
    mrect.moveTo(mx,my);
    if(my>=800+mrect.height())
    {
        mfree=true;
    }
}
